﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="IComponentSettingsManager.cs" company="Roman '4ux-nbIx' Novitsky">
//   Copyright (c) Roman '4ux-nbIx' Novitsky 2009
// </copyright>
// <summary>
//   Defines a component settings manager interface.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace SettingsManager.ComponentSettingsManagers
{
  #region Namespace Imports

  using System.Xml;

  using JetBrains.Annotations;

  #endregion


  /// <summary>
  /// Defines a component settings manager interface.
  /// </summary>
  internal interface IComponentSettingsManager
  {
    #region Properties

    /// <summary>
    /// Gets the name of the component.
    /// </summary>
    /// <value>
    /// The name of the component.
    /// </value>
    string ComponentTagName
    {
      get;
    }

    /// <summary>
    /// Gets the name of the settings.
    /// </summary>
    /// <value>
    /// The name of the settings.
    /// </value>
    string Name
    {
      get;
    }

    #endregion


    #region Public Methods

    /// <summary>
    /// Gets the options form.
    /// </summary>
    /// <returns>
    /// The options form.
    /// </returns>
    [CanBeNull]
    SettingsManagerOptionsForm GetOptionsForm();


    /// <summary>
    /// Loads the options.
    /// </summary>
    /// <param name="optionsElement">
    /// The options element.
    /// </param>
    /// <returns>
    /// Returns an instance of <see cref="System.Object"/>.
    /// </returns>
    object LoadOptions([NotNull] XmlElement optionsElement);


    /// <summary>
    /// Saves the options.
    /// </summary>
    /// <param name="optionsElement">
    /// The options element.
    /// </param>
    /// <param name="options">
    /// The options.
    /// </param>
    void SaveOptions([NotNull] XmlElement optionsElement, [NotNull] object options);

    #endregion
  }
}